use tokio::sync::oneshot;

#[tokio::test]
async fn test_oneshot_channel() {
    let (tx, rx) = oneshot::channel();

    tokio::spawn(async move {
        if let Err(e) = tx.send(3) {
            println!("the receiver dropeed {:?}", e);
        }
    });

    match rx.await {
        Ok(v) => println!("got: {v}"),
        Err(e) => println!("the sender dropeed {:?}", e),
    };
}
